package ren.steve.system.custom;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import ren.steve.model.system.bean.SystemUser;

import java.util.Collection;


/**
 * 自定义用户信息
 */
public class CustomUser extends User {

  private SystemUser systemUser;

  public SystemUser getSystemUser() {
    return systemUser;
  }

  public void setSystemUser(SystemUser systemUser) {
    this.systemUser = systemUser;
  }

  public CustomUser(SystemUser user, Collection<? extends GrantedAuthority> authorities) {
    super(user.getCode(), user.getPassword(), authorities);
    this.systemUser = user;
  }
}
